var http = require('http'),
  querystring = require('querystring');

http.createServer(function(req, res) {
  var postData = '';
  req.addListener('data', function(chunk) {
    postData += chunk;
  });
  req.addListener('end', function() {
    var postStr = JSON.stringify(querystring.parse(postData));
    res.writeHead(200, { 'Content-Type': 'text/plain' });
    res.end(postStr + '\n' + req.method);
  });
}).listen(3000);
console.log('server start at http://localhost:3000');